package com.dhcc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dhcc.entity.Student;
import com.dhcc.service.StudentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@RestController
@RequestMapping("/master/student")
public class StudentController {
	
	@Autowired
	private StudentService studentService;

	@GetMapping("/list")
	public PageInfo<Student> findStudents(){
		PageHelper.startPage(2, 10);
		List<Student> findByStudents = studentService.findByStudents();
		PageInfo<Student> pageInfo = new PageInfo<>(findByStudents);
		return pageInfo;
	}
}
